import { useState } from 'react'
import './index.less'
import { Button } from 'antd';
import { getData } from '@/api/test.js'
import Counter from '@/components/test/Counter';
import Heading from './components/Heading.jsx';
import Section from './components/Section.jsx';
export let baseURL = import.meta.env.VITE_APP_BASE_API

export default function(){
  const [count, setCount] = useState(0)
  console.log('baseURL', baseURL);
  const onClick = async () => {
    try {
      console.log('按钮被点击了');
    	setCount((count) => count + 1)
    	let res = await getData()
    	console.log('res', res)
    }catch(err){
        console.error(err)
    }
  }
  return (
    <div className="page-test">
      <div className="card">
        <button onClick={onClick}>
          count is {count}
        </button>
      </div>
      <div>
        <Button type="primary" onClick={onClick}>Button</Button>
      </div>
        <h1 className="text-3xl font-bold underline">
      	Hello world!
      </h1>
      <Counter></Counter>
      <Section>
        <Heading>主标题</Heading>
        <Section>
          <Heading>副标题</Heading>
          <Heading>副标题</Heading>
          <Heading>副标题</Heading>
          <Section>
            <Heading>子标题</Heading>
            <Heading>子标题</Heading>
            <Heading>子标题</Heading>
            <Section>
              <Heading>子子标题</Heading>
              <Heading>子子标题</Heading>
              <Heading>子子标题</Heading>
            </Section>
          </Section>
        </Section>
      </Section>
    </div>
  )
}
